package com.tqjc.system.C24012.common.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.NotNull;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @Author: 86195
 * @CreateTime: 2024-06-28  09:08
 * @Description: TODO
 * @Version: 1.0
 */
@TableName("tqjc_zy_area_info")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SysAreaInfoEntity implements Comparable<SysAreaInfoEntity>{

    //主键
    private Long id;
    //库区长度
    private Integer areaLength;
    //库区宽度
    private Integer areaWidth;
    //库区行位置
    private Integer linePosition;
    //库区列位置
    private Integer columnPosition;

    //当前层数
    private Integer currLayer;

    //库区左上点坐标
    private Integer leftTopXIndex;

    //库区左上点Y坐标
    private Integer leftTopYIndex;

    //所属大区   1：7-1    2:7-2
    private String areaIndex;



    @TableField(value="CREATE_NAME", fill= FieldFill.INSERT)
    private String createName;

    @TableField(value="CREATE_DATE", fill=FieldFill.INSERT)
    private LocalDateTime createDate;

    @TableField(value="UPDATE_NAME", fill=FieldFill.UPDATE)
    private String updateName;

    @TableField(value="UPDATE_DATE", fill=FieldFill.UPDATE)
    private LocalDateTime updateDate;


    @Override
    public int compareTo(@NotNull SysAreaInfoEntity o) {
        if(this.linePosition > o.getLinePosition()){
            return 1;
        }

        if(this.leftTopYIndex > o.getLeftTopYIndex()){
            return 1;
        }
        return 0;
    }


}
